//
//  WHNetworkTool.h
//  DishManager
//
//  Created by she1323 on 16/7/28.
//  Copyright © 2016年 she1323. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^SuccessBlock)(id responseObject);

typedef void(^FailBlock)(NSError *error);

typedef void(^ConstructingBodyBlock)(id
                                     formData);

@interface WHNetworkTool : NSObject

+ (__kindof WHNetworkTool *)shareInstance;

/**
 *  POST请求
 */
- (void)sendPostWithUrl:(NSString *)url params:(NSDictionary *)params success:(SuccessBlock)successBlock fail:(FailBlock)failBlock;


/**
 包含请求头的post请求
 */
- (void)sendPostWithUrl:(NSString *)url header:(NSDictionary *)header params:(NSDictionary *)params success:(SuccessBlock)successBlock fail:(FailBlock)failBlock;

- (void)sendGetWithUrl:(NSString *)url params:(NSDictionary *)params success:(SuccessBlock)successBlock fail:(FailBlock)failBlock;

- (void)sendPostWithUrl:(NSString *)url params:(NSDictionary *)params constructingBodyWithBlock:(ConstructingBodyBlock)constructingBodyBlock success:(SuccessBlock)successBlock fail:(FailBlock)failBlock;

- (void)cancel;

@property (nonatomic, assign) double timeOut;

@end
